#pragma once
#pragma comment (lib, "Wininet.lib")

#include "stdafx.h"
#include <WinInet.h>



class Connection
{
public:
	Connection();
	~Connection(void);
	int connect();
	
	void close(){if(connected){connected = false;InternetCloseHandle(query);InternetCloseHandle(session);InternetCloseHandle(open);}}
	void setChangeSet(char *changeSet){this->changeSet = changeSet;}
	int loadFile(char *path);
	int sendRequest(char*);
	char* receive();
	int requestFile(char *path, char *file);

private:
	HINTERNET open, session, query;
	bool connected;
	char *changeSet;	
};

